/*
 *  JournalWindow.java 
 *    
 *    Copyright 2012 YAWP Project Team
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.googlecode.yawp.view;

import javax.swing.JPanel;
import java.awt.BorderLayout;
import javax.swing.JButton;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

/**
 * The Journal Window Provides a view to enter and maintain 
 * Journal entries that are associated with weight gain or loss
 * 
 * @author ccato
 *
 */
public class JournalWindow extends JPanel {
	private JTable table;

	/**
	 * Create the panel.
	 */
	public JournalWindow() {
		setLayout(new BorderLayout(0, 0));
		
		JPanel panel = new JPanel();
		add(panel, BorderLayout.SOUTH);
		
		JButton btnOk = new JButton("Ok");
		panel.add(btnOk);
		
		JButton btnEdit = new JButton("Delete");
		btnEdit.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
			}
		});
		
		JButton btnNew = new JButton("New");
		panel.add(btnNew);
		panel.add(btnEdit);
		
		JButton btnEdit_1 = new JButton("Edit");
		panel.add(btnEdit_1);
		
		JScrollPane scrollPane = new JScrollPane();
		add(scrollPane, BorderLayout.CENTER);
		
		
		String[] columnNames = {"Date",
                "Category",
                "Value",
                "Comment"};

		Object[][] data = {
			    {"1/4/2012", "Blood Presure",
			     "120/80", "Doctors Visit"},
			    {"1/3/2012", "Exercise",
			     "1.5", "Long Walk"},
			    {"1/2/1012", "A1C",
			     "6.8", "Blood Sugar"},
			    {"1/2/2012", "Exercise",
			     "2", "Rowing"}
			}; 
		
		table = new JTable(data, columnNames);
		scrollPane.setViewportView(table);

	}

}
